Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(routing): upgrade to GraphHopper 8.0 #363

Merged
merged 22 commits into from
Mar 21, 2024
Merged

feat(routing): upgrade to GraphHopper 8.0 #363

merged 22 commits into from
Mar 21, 2024

Conversation

kschrab
Copy link
Contributor

@kschrab kschrab commented Nov 2, 2023

Description

  • This PR upgrades the GraphHopper library to version from 0.13.0 (2019) to latest release 8.0.
  • Some easy migration paths involved renamings (e.g., QueryResult -> Snap)
  • The FlagEncoder has been removed completely, and was replaced by a collection of EncodedValue classes. The FlagEncoder previously just read one or more integer flags from an edge and encoded/decoded information, such as allowed speed or the waytype. Now, we must use an EncodedValue implementation for every aspect. For example, VehcileSpeed or VehicleAccess, which exist for encoding the average speed and the access to use a certain edge. For each vehicle type (here called profile, e.g. "car", or "bike"), individual instances of these EncodedValue types exist. This lead to a rather large refactoring, but could be solved by adding a new VehicleEncoding class which just bundles these individual EncodedValue types needed for a profile/vehicle.
  • Previously, the route functionality was implemented twice. First, as a direct extension of the GraphHopper implementation (which serves as an API end point), and secondly, in GraphHopperRouting which implements the the mosaic-routing API. I removed the implementation in ExtendedGraphHopper and kept only the one in GraphHopperRouting. Therefore ExtendedGraphHopper currently only replaces the import mechanism of the GraphHopper implementation to create the routing graph from a mosaic database. I removed the implementation ExtendedGraphHopper completely and moved everything related to graph loading to GraphHopperRouting, having one entry point.
  • All additional routing algorithm implementations based on AbstractCamvitChoiceRouting have been removed. With the current release, GraphHopper already comes with plateau based algorithms to search for alternative routes. These are more or less based on the Camvit Choice Routing algorithm and therefore expect to produce similar results. To avoid a complicated migration of our own implementations, we use the provided ones for now.
  • After migration, some tests related to turn costs now result in slightly different costs. I could not yet find a reason for this, but I still feel that the guessed turn costs are okay.

Issue(s) related to this PR

  • Resolves internal issue 716

Affected parts of the online documentation

Changes in the documentation required?

No

Definition of Done

Prerequisites

  • You have read CONTRIBUTING.md carefully.
  • You have signed the Contributor License Agreement.
  • Your GitHub user id is linked with your Eclipse Account.

Required

  • The title of this merge request follows the scheme type(scope): description (in the style of Conventional Commits)
  • You have assigned a suitable label to this pull request (e.g., enhancement, or bugfix)
  • origin/main has been merged into your Fork.
  • Coding guidelines have been followed (see CONTRIBUTING.md).
  • All checks on GitHub pass.
  • All tests on Jenkins pass.

Requested (can be enforced by maintainers)

  • New functionality is covered by unit tests or integration tests. Code coverage must not decrease.
  • If a bug has been fixed, a new unit test has been written (beforehand) to prove misbehavior
  • There are no new SpotBugs warnings.

Special notes to reviewer

@kschrab kschrab added the chore Pull request that resolve around a chore label Nov 2, 2023
@kschrab kschrab marked this pull request as ready for review November 2, 2023 15:17
pom.xml Outdated Show resolved Hide resolved
Copy link
Contributor

@schwepmo schwepmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some remarks.

@kschrab kschrab self-assigned this Mar 20, 2024
}

/**
* @return the list of connection ids forming this route.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these type of javadocs leads to spotbugs warnings, as the actual documentation is missing.
Personally, I think the documentation for getters should either be really verbose (like the member variable) or none.

Copy link
Contributor Author

@kschrab kschrab Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular case I'd need the documentation at the getters, since the user wants to know what the offset is doing. However, for getters I find it personally more useful to fill @return and leave the description blank, as this would be the same text. I'd rather adjust our checkstyle...

@@ -0,0 +1,159 @@
/*
* Copyright (c) 2020 Fraunhofer FOKUS and others. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to adjust this year, as this file is marked as "new"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't have to do this.

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2020 Fraunhofer FOKUS and others. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to adjust this year, as this file is marked as "new"?

@schwepmo schwepmo merged commit 7bdf6ae into main Mar 21, 2024
6 checks passed
@schwepmo schwepmo deleted the 716-graphhopper-8 branch March 21, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull request that resolve around a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants